// @ts-ignore
/* eslint-disable */
import { request } from "@umijs/max";

/** 此处后端没有提供注释 POST /user/change-password */
export async function changePassword(
  body: Record<string, any>,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/user/change-password", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/info */
export async function getUserInfo(options?: { [key: string]: any }) {
  return request<API.ResultObject>("/user/info", {
    method: "GET",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/list */
export async function getUserList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserListParams,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/user/list", {
    method: "GET",
    params: {
      // page has a default value: 1
      page: "1",
      // pageSize has a default value: 10
      pageSize: "10",
      ...params,
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/reset-password */
export async function resetPassword(
  body: Record<string, any>,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/user/reset-password", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /user/update */
export async function updateUser(
  body: API.UserDTO,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/user/update", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/update-status */
export async function updateUserStatus(
  body: Record<string, any>,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/user/update-status", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
